function [ d,RSRPinfo, SINRinfo, SINRinfo_db ] = getRSRP( userNum,userinfo,MBSinfo,PBSinfo,FBSinfo )
global MBSnum PBSnum FBSnum Pm Pp Pf No
% d=zeros(200,MBSnum+PBSnum+FBSnum);
% RSRPinfo=zeros(200,MBSnum+PBSnum+FBSnum);
for i=1:userNum
    x=userinfo(i,1);
    y=userinfo(i,2);
    dm=sqrt((x-MBSinfo(1,1))^2+(y-MBSinfo(1,2))^2);
    RSRPm=Pm-(34+40.*log10(dm));
    dp=sqrt((x-PBSinfo(:,1)).^2+(y-PBSinfo(:,2)).^2);
    RSRPp=Pp-(34+40.*log10(dp));
    df=sqrt((x-FBSinfo(:,1)).^2+(y-FBSinfo(:,2)).^2);
    RSRPf=Pf-(37+30.*log10(df));
    d(i,:)=[ dm' dp' df'];
    RSRPinfo(i,:)=[ RSRPm' RSRPp' RSRPf'];
     RSRPinfo(i,:)=RSRPinfo(i,:);
     [p,q]=find(RSRPinfo==0);
     RSRPinfo(p,q)=-inf;
    for j=1:MBSnum+PBSnum+FBSnum
        RSRPinfo_w=10.^(RSRPinfo./10);
        No_w=10^(No/10)/1000;
        SINRinfo(i,j)=RSRPinfo_w(i,j)/(sum(RSRPinfo_w(i,:))-RSRPinfo_w(i,j)+No_w*180e3);
        SINRinfo_db(i,j)=10.*log10(SINRinfo(i,j));
        SINRinfo_db(i,j)=SINRinfo(i,j);
    end
end


